<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
		<h:form>
			<h:outputText value="APPLY LEAVE" styleClass="outputTextTitle" />
			<h:panelGrid columns="1" >
			<p:growl></p:growl>
				
				<h:panelGrid columns="6" style="border: 1px solid #d9d9d9;width: 100%" cellspacing="10">
				  <h:outputLabel value="#{msg['employeeid.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{applyLeaveBean.wamUser.employeeCode}" readonly="true"/>  
	                </p:inplace>
					
					<h:outputLabel value="#{msg['employeename.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{applyLeaveBean.empName}" readonly="true"/>  
	                </p:inplace>
	               
					<h:outputLabel value="#{msg['modulename.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{applyLeaveBean.wamUser.employee.moduleName}" readonly="true"/>  
	                </p:inplace>
					
					<h:outputLabel value="#{msg['projectname.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="xxx" readonly="true"/>  
	                </p:inplace>
	               
	                <h:outputLabel value="#{msg['projectmanager.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{applyLeaveBean.reportingManagerName}" readonly="true"/>  
	                </p:inplace>
	               
	                <h:outputLabel value="#{msg['tomail.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                       <p:inputText value="#{applyLeaveBean.reportingManager.email}"/> 
	                       
	                </p:inplace>
	             
	              
	                
	                 <h:outputLabel  value="#{msg['leavetype.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:selectOneMenu value="#{applyLeaveBean.selectedLeaveTypeId}" style="width:150px;">
						<f:selectItem itemLabel="Select a leave type" itemValue="" />
						<f:selectItems value="#{applyLeaveBean.leaveTypesMap}" />
					
					</p:selectOneMenu>
	                <h:inputHidden />
	                <h:inputHidden />
	                <h:inputHidden /> 
	                <h:outputLabel  value="#{msg['leavefrom.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:calendar showButtonPanel="true" value="#{applyLeaveBean.employeeLeave.periodFrom}"/>
	                
	                 <h:outputLabel  value="#{msg['leaveto.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:calendar showButtonPanel="true" value="#{applyLeaveBean.employeeLeave.periodTo}"/>
					<h:inputHidden/>
					<h:inputHidden/>
					<h:panelGroup>
                     <p:commandButton  value="Confirm" action="#{applyLeaveBean.confirmLeaveBeforeApply}"/>
                     </h:panelGroup>
                     <h:inputHidden/>
                     <h:inputHidden/>
                     <h:inputHidden/>
				</h:panelGrid>
				<h:panelGrid>
				
				</h:panelGrid>
				<h:panelGrid columns="6" style="border: 1px solid #d9d9d9;width: 100%" cellspacing="10" >
				  <h:outputLabel value="#{msg['nodays.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace>  
	                       <p:inputText value="#{applyLeaveBean.noOfDays}" readonly="true"/>  
	                </p:inplace>
					
					<h:outputLabel value="#{msg['contactnumber.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
					<p:inplace >   
	                 <p:inputText value="#{applyLeaveBean.wamUser.employee.telephone}"/> 
                    </p:inplace>
                    <h:outputLabel value="#{msg['availableaddress.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
                    <p:inputTextarea value="#{applyLeaveBean.employeeLeave.availableAddress}"/> 
                    <h:outputLabel value="#{msg['reasonforleave.label']}" style="font-size: 12px;" />
					<h:outputLabel value=" : " />				
                    <p:inputTextarea value="#{applyLeaveBean.employeeLeave.reason}"/>  
                    <h:inputHidden /><h:inputHidden />
	               
	                <h:panelGroup>
	                 <p:commandButton  value="Submit" actionListener="#{applyLeaveBean.applyLeaveAction}" ajax="false" update="@form"/>
					 <p:commandButton  value="Cancel"/>
					</h:panelGroup>
					<h:inputHidden /><h:inputHidden />
					<h:inputHidden /><h:inputHidden />
					<h:inputHidden /><h:inputHidden />
					<h:inputHidden /><h:inputHidden />
					
				
				</h:panelGrid>
				<h:outputLabel style="color:blue;" value="Note:Submitting the leave will automatically send email to TomailId address with Reason given above." />	
			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>

